import numpy as np

x_original = np.random.rand(3, 5)
shape = x_original.shape
dtype = str(x_original.dtype)
print(x_original)

x_byte = bytes(x_original)

x_restore = np.frombuffer(x_byte, dtype).reshape(shape)
print(x_restore)
